package com.xpsoft.oa.dao.project.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.project.ProjectReceiveInfoDao;
import com.xpsoft.oa.model.project.ProjectReceiveInfo;

public class ProjectReceiveInfoDaoImpl extends BaseDaoImpl<ProjectReceiveInfo> implements ProjectReceiveInfoDao{

	public ProjectReceiveInfoDaoImpl() {
		super(ProjectReceiveInfo.class);
	}

	@Override
	public void deleteProjectReceiveInfos(Long receiveId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from ProjectReceiveInfo where id not in (:ids) and projectReceive.id=:receiveId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("receiveId", receiveId);
		query.executeUpdate();
	}

}